package com.yw.common.core.db;

import com.yw.common.core.db.impl.SqlserverConnectionImpl;
import com.yw.common.core.db.proxy.SqlserverConnectionProxy;
import com.yw.common.core.util.ConfigUtil;

/**
 * 数据库连接工厂
 * @author aoshiguchen
 * @time 2015-09-10
 */

public final class DBConnectionFactory {
	private static IDBConnection sqlserverConnection = null;
	
	public static IDBConnection createSqlServerConnection(){
		if(null == sqlserverConnection){
			sqlserverConnection = new SqlserverConnectionProxy(new SqlserverConnectionImpl(ConfigUtil.getDbUrl(),ConfigUtil.getDbName(), ConfigUtil.getDbLoginName(),ConfigUtil.getDbLoginPassword()));
		}
		
		return sqlserverConnection;
	}
}
